<template>
  <el-card>
    <div class="box">
      <img :src="userStore.avatar" alt="" class="avatar" />
      <div class="bottom">
        <h3 class="title">{{ getHours() }}好呀{{ userStore.username }}</h3>
        <p class="subtitle">运营平台</p>
      </div>
    </div>
  </el-card>
  <div class="bottoms">
    <SvgIcon name="welcome" width="500px" height="70vh"></SvgIcon>
  </div>
</template>

<script setup lang="ts">
import { onMounted } from 'vue'
import { getHours } from '@/utils/time'
//引入用户相关的仓库.获取与当前用户的头像和昵称
import useUserStore from '@/store/modules/user'
//存储用户信息的仓库对象
let userStore = useUserStore()
onMounted(() => {
  userStore.userInfo()
})
</script>

<style lang="scss" scoped>
.box {
  display: flex;
  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  .bottom {
    margin: 10px 0 10px 10px;
    .title {
      font-size: 30px;
      font-weight: 900px;
      margin-bottom: 30px;
    }
    .subtitle {
      font-style: italic;
      color: aqua;
    }
  }
}
.bottoms {
  margin-top: 30px;
  display: flex;
  justify-content: center;
}
</style>
